package _上课;

import java.util.Scanner;

public class SchoolClassTest {
    public static void main(String[] args) {
        JClass j76 = new JClass();
        j76.name = "课工场76班";
        j76.startTime = "2021-9-15";
        j76.dirTeacher = "老李";
        j76.techTeacher = "老刘";
        ///j76.stus[0]="孙囡囡";
        Scanner in=new Scanner(System.in);
        int choice = 0;
        j76.jia();
        while (true) {
            System.out.println("1:添加新生，2：显示全部,3:查找学生，4区间查找，5,查找指定位置的学生，6,修改学生姓名,7,查看人数9：退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("请输入新生姓名：");
                String sname = in.next();
                j76.add(sname);
            } else if (choice == 2) {
                j76.printInfor();
            } else if (choice == 3) {
                System.out.print("找谁？");
                String sname = in.next();
                boolean b = j76.search(sname);
                System.out.println(b ? "在这个班" : "不在!");
            }
            else if (choice==4){
                System.out.print("输入要查找的区间：");
                int kk=in.nextInt();
                int kkk=in.nextInt();
                System.out.print("需要找谁:");
                String name1=in.next();

                System.out.println(j76.find(kk,kkk,name1)?"有":"没有");
//                boolean m=j76.find(kk,kkk,name1);
//                System.out.println(m?"有":"没有");

            }else if(choice==5){
                System.out.print("请输入位置：");
                int num=in.nextInt();
                String name2=j76.find(num);
                System.out.println(name2);
            }else if(choice==6){
                System.out.print("输入要修改的姓名:");
                String name3=in.next();
                System.out.print("输入修改的名字：");
                String name4=in.next();
                boolean ff=j76.modify(name3,name4);
                System.out.println(ff?"修改成功":"没有这位同学");
            }else if (choice==7){
                System.out.println(j76.renshu());
            }else if (choice == 9) {
                break;
            }
        }
        System.out.println("结束了。。。");
    }
}